<?php 

$a=array(
//对第一个关键字进行排序
array('key1'=>940,'key2'=>'blah'),
array('key1'=>23,'key2'=>'this'),
array('key1'=>894,'key2'=>'that')
	);
function asc_number_sort($x,$y){
	if($x['key1']>$y['key1']){
		return true;
	}elseif($x['key1']<$y['key1']){
		return false;
	}else{
		return 0;
	}
}
usort($a, 'asc_number_sort');
//var_dump($a);
//对第二个关键字进行排序
function string_sort($x,$y){
	return strcasecmp($x['key2'],$y['key2']);
}
usort($a, 'string_sort');
var_dump($a);

 ?>